import 'package:car_baidu/ui/shared/theme/app_theme.dart';
import 'package:flutter/material.dart';

import '../shared/px/double_extentsion.dart';
import '../shared/px/int_extentsion.dart';

class LLSingleInputWidget extends StatelessWidget {
  final TextEditingController? controller;
  final Widget leading;
  final Widget treading;
  final String placeHold;
  final FocusNode? focusNode;

  LLSingleInputWidget({
    this.controller,
    this.leading = const Icon(Icons.phone),
    this.placeHold = "请输入",
    this.focusNode,
    Widget? treading,
    Key? key,
  })  : treading = treading ?? Container(),
        super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(bottom: 3.px, top: 8.px),
      decoration: BoxDecoration(
          border: Border(
              bottom: BorderSide(
                  color: Color.fromARGB(255, 227, 227, 227), width: 0.5.px))),
      child: Row(children: [
        leading,
        SizedBox(
          width: 10.px,
        ),
        Expanded(
          child: TextField(
            controller: controller,
            decoration: InputDecoration.collapsed(hintText: placeHold),
            cursorColor: LLAppTheme.primaryColor,
            style: LLAppTheme.largerTextStyle,
            focusNode: focusNode,
          ),
        ),
        treading,
      ]),
    );
  }
}
